import request from '@/utils/request'

// 查询发文列表
export function listPostProcessSheet(query) {
  return request({
    url: '/system/dispatch/list',
    method: 'post',
    params: query
  })
}

// 新增并启动流程发文
export function addPostProcessSheet(data) {
  return request({
    url: '/system/dispatch/applicant',
    method: 'post',
    data: data
  })
}

// 新增/编辑发文
export function addEditPostProcessSheet(data) {
  return request({
    url: '/system/dispatch/add',
    method: 'post',
    data: data
  })
}

// 发文详情
export function detailsPostProcessSheet(query) {
  return request({
    url: '/system/dispatch/query',
    method: 'get',
    params: query
  })
}

// 发文启动流程
export function startPostProcessSheet(query) {
  return request({
    url: '/system/dispatch/submitDispatch',
    method: 'post',
    params: query
  })
}

// 发文处理审批办理
export function approvalListPostProcessSheet(query) {
  return request({
    url: '/system/dispatch/showVerifyDialog',
    method: 'get',
    params: query
  })
}

// 发文流程审批处理提交
export function submitPostProcessSheet(query) {
  return request({
    url: '/system/dispatch/complete',
    method: 'get',
    params: query
  })
}

// 发文流程承办人处理提交
export function cbrSubmitPostProcessSheet(query) {
  return request({
    url: '/system/dispatch/undertake',
    method: 'get',
    params: query
  })
}

// 发文流程归档处理提交
export function fileSubmitPostProcessSheet(query) {
  return request({
    url: '/system/dispatch/keepFile',
    method: 'get',
    params: query
  })
}

// 删除发文
export function delProcessModel(query) {
  return request({
    url: '/system/dispatch/remove',
    method: 'post',
    params: query
  })
}

// 导出呈批件
export function exportProcessModel(modelId) {
  return request({
    url: '/system/modeler/export/'+modelId,
    method: 'get',
  })
}

// 获取单位列表信息
export function deptProcessModel() {
  return request({
    url: '/system/dispatch/dept',
    method: 'post',
  })
}

// 获取用户列表信息
export function getUserList() {
  return request({
    url: '/system/dispatch/user',
    method: 'post',
  })
}

// 打印呈批件
export function printProcessSheet(query) {
  return request({
    url: '/system/dispatch/print',
    method: 'get',
    params: query
  })
}
